package com.itheima.homework.assignment.Test03;

/**
 * 定义子类Bear(北极熊) 继承Animal类,重写父类中的抽象方法eat(),方法体输出 "白色4腿的北极熊在吃蜂蜜"
 * 定义特有方法catchFish(),方法体输出"白色4腿的北极熊在抓鱼"
 */
public class Bear extends Animal {
    public Bear() {
        super();
    }

    public Bear(String color, int numOfLegs) {
        super(color, numOfLegs);
    }

    @Override
    public void eat() {
        System.out.println(getColor() + getNumOfLegs() + "条腿的北极熊在吃蜂蜜");
    }

    public void catchFish() {
        System.out.println(getColor() + getNumOfLegs() + "条腿的北极熊在抓鱼");
    }
}
